public class DataMapper {

	private IDataSource ds;
	private IDataCommand dc;
	
	
	public DataMapper () {
		this.ds = DataSourceFactory.GetDataSource(this.getDataSourceId());
	}

	private String getDataSourceId() {
		return "DATA_SOURCE";
	}
	
	public void setDataCommand(String findStatement){
		this.dc = this.ds.GetCommand(findStatement);
	}
	
	public IDataCommand getDataCommand(){
		return this.dc;
	}
	
	public IDataCommand makeCommand(String statementId, Parametro[] parametros){
		this.dc = this.ds.GetCommand(statementId);
		for (int i = 0; i < paramentros.Length; i++){
			this.dc.Parameters[parameters[i].nombre] = parametros[i].valor;
		}

		return this.dc;
	}
	
}
